package cn.ppwx.crm.modules.sys.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.ppwx.crm.modules.sys.entity.User;
import cn.ppwx.crm.modules.sys.service.UserService;

@Component
public class CashierTaskListenerImpl implements TaskListener {

	
	@Autowired
	private UserService userService;
	
	/**用来指定任务的办理人*/
	@Override
	public void notify(DelegateTask delegateTask) {
		
		User user = userService.getUserById(2003);
		delegateTask.setAssignee(user.getUserId()+"."+user.getUserName());
		
	}

}